package com.vst.hsd.dominio;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.vst.util.Entidad;


/**
 * The persistent class for the columna database table.
 * 
 */
@Entity
@Table(name="columna")
public class Columna implements Entidad , Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.TABLE, generator="generatorColumna")  
	@TableGenerator(name="generatorColumna", table="TableColumna",  
	                pkColumnName="id_tableColumna", // TableID.TableName (value = table_name, test_table, etc.)  
	                valueColumnName="id", // TableID.ID (value = 1,2,3,etc.)  
	                allocationSize=1, // flush every 1 insert  
	                initialValue=1) 
	@Column(name="id_columna")
	private Integer id;
	
	@Column(name="addColumn")
	private Boolean addColumn;
	
	@Column(name="ancho")
	private int ancho;

	@Column(name="atributo")
	private String atributo;
	
	@Column(name="cabecera")
	private String cabecera;
	
	@Column(name="codigo")
	private String codigo;

	@Column(name="mapping")
	private Boolean mapping;

	@Column(name="visible")
	private Boolean visible;

	//bi-directional many-to-many association to Grid
	//@ManyToMany(mappedBy="columnas")
	//private List<Lista> listas;

	@ManyToMany
	@JoinTable(
		name="column_por_grid"
		, joinColumns={
			@JoinColumn(name="id_columna")
			}
		, inverseJoinColumns={
			@JoinColumn(name="id_recurso")
			}
		)
	private List<Lista> listas;
	
	
    public Columna() {
    }

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Boolean getAddColumn() {
		return addColumn;
	}

	public void setAddColumn(Boolean addColumn) {
		this.addColumn = addColumn;
	}

	public int getAncho() {
		return ancho;
	}

	public void setAncho(int ancho) {
		this.ancho = ancho;
	}

	public String getCabecera() {
		return cabecera;
	}

	public void setCabecera(String cabecera) {
		this.cabecera = cabecera;
	}

	

	public String getAtributo() {
		return atributo;
	}

	public void setAtributo(String atributo) {
		this.atributo = atributo;
	}

	public String getCodigo() {
		return codigo;
	}

	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}

	public List<Lista> getListas() {
		return listas;
	}

	public void setListas(List<Lista> listas) {
		this.listas = listas;
	}

	public Boolean getMapping() {
		return mapping;
	}

	public void setMapping(Boolean mapping) {
		this.mapping = mapping;
	}

	public Boolean getVisible() {
		return visible;
	}

	public void setVisible(Boolean visible) {
		this.visible = visible;
	}

	
	

/*	public List<Lista> getListas() {
		return listas;
	}

	public void setListas(List<Lista> listas) {
		this.listas = listas;
	}
*/
	public String getLabel() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getNombreCompleto() {
		// TODO Auto-generated method stub
		return null;
	}

    
    
    
}